<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<div id="app">
    <h1>商品数量：{{count}} 个</h1>
    <h1>商品单价：{{unitPrice}} 元</h1>
    <h1>商品总价：{{totalPrice()}} 元</h1>
</div>
</body>
<script src="../../js/vue.js"></script>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            count: 10,
            unitPrice: 24
        },
        methods: {
            totalPrice() {
                return this.count * this.unitPrice
            }
        }
    })
</script>
</html>
